<template>
  <div class="container">
    <!-- 筛选条件 -->
    <div class="screen-box">
      <span v-for="(item, index) in filterList" :key="item" @click="handleClick(index)"
        :class="{ active: index === currentIndex }">{{ item }}</span>
    </div>
    <!-- 竞赛列表 -->
    <ul v-loading="loading && data.length === 0" class="box">
      <li v-loading="loading" v-if="data.length > 0" class="box-item" v-for="item in data" :key="item.categoryId">
        <el-image :src="item.cover" style="height: 150px; width: 300px; min-width: 150px;"
          :placeholder="item.title"></el-image>
        <div class="text">
          <p>{{ item.title }}</p>
          <p>竞赛时间：{{ item.startDate }} ~ {{ item.endDate }}</p>
        </div>
        <div v-if="currentIndex === 2" class="btn">
          <el-button @click="route.push({
            path: '/applicationInfo', query: { id: item.id, type: 0, title: item.title }
          })">查看报名信息</el-button>
        </div>
      </li>
      <div v-if="data.length === 0 && loading === false" class="svg" style="display: flex; justify-content: center; align-items: center; height: 100%;">
        <svg t="1717415887168" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
          p-id="4769" width="400" height="400">
          <path
            d="M771.64 117.874c-1.25 0-2.616-0.342-3.754-1.024-14.79-8.989-14.905-29.469-14.905-30.265a7.26 7.26 0 0 1 7.282-7.282c3.982 0 7.282 3.3 7.282 7.282 0 3.64 1.479 13.88 7.85 17.863 3.414 2.048 4.552 6.6 2.504 10.012-1.366 2.162-3.755 3.414-6.258 3.414z m-4.095-31.403z"
            fill="#999999" p-id="4770"></path>
          <path
            d="M765.952 108.658c-2.048 0-3.982-0.797-5.461-2.39-2.731-2.958-2.503-7.623 0.569-10.353 0.568-0.57 14.108-12.743 30.378-23.894 23.894-16.497 40.846-21.845 51.655-16.497 8.42 4.096 12.06 13.54 10.81 27.875-0.342 3.982-3.87 7.054-7.851 6.713-3.983-0.341-7.055-3.868-6.713-7.85 0.569-7.396-0.455-12.402-2.731-13.54-7.282-3.641-35.499 10.809-65.764 38.115-1.365 1.138-3.185 1.82-4.892 1.82z"
            fill="#999999" p-id="4771"></path>
          <path
            d="M780.63 134.6c-0.57 0-1.138-0.115-1.707-0.228-3.983-0.91-6.372-4.893-5.462-8.761 3.414-14.791 16.043-27.99 16.498-28.445 2.845-2.958 7.396-2.958 10.354-0.114 2.844 2.845 2.958 7.396 0.227 10.354-0.113 0.114-10.24 10.81-12.856 21.618-0.797 3.3-3.755 5.575-7.055 5.575z m66.104-16.726c-2.958 0-5.802-1.82-6.94-4.893-5.575-15.587-17.636-15.587-19.001-15.473-3.982 0.227-7.51-2.845-7.737-6.827-0.228-3.982 2.844-7.51 6.827-7.737 8.305-0.569 26.055 4.096 33.678 25.259 1.365 3.754-0.683 7.964-4.437 9.33-0.683 0.227-1.48 0.34-2.39 0.34z"
            fill="#999999" p-id="4772"></path>
          <path
            d="M837.404 140.63c-2.275 0-4.55-1.138-6.03-3.073-4.21-6.03-8.647-8.988-13.54-9.33-8.191-0.455-16.725 7.055-19.342 10.013-2.73 2.958-7.281 3.3-10.353 0.569-2.959-2.73-3.3-7.282-0.683-10.354 0.569-0.683 14.108-15.815 31.061-14.905 9.558 0.57 17.863 5.69 24.69 15.474 2.276 3.3 1.48 7.85-1.82 10.24-1.138 0.91-2.617 1.365-3.983 1.365z"
            fill="#999999" p-id="4773"></path>
          <path
            d="M818.517 176.47a7.15 7.15 0 0 1-4.21-1.366c-17.066-12.174-5.12-47.218-2.616-54.158 1.365-3.755 5.575-5.69 9.443-4.324 3.755 1.366 5.69 5.575 4.324 9.444-5.348 14.563-7.737 33.45-2.617 37.091 3.3 2.39 4.096 6.94 1.707 10.24-1.48 2.048-3.755 3.072-6.03 3.072z"
            fill="#999999" p-id="4774"></path>
          <path
            d="M813.739 180.338c-12.288 0-22.187-4.779-27.535-9.102-3.072-2.504-3.527-7.168-1.024-10.24s7.168-3.528 10.24-1.024c0.91 0.682 20.367 15.587 45.284-5.234 3.072-2.617 7.737-2.162 10.354 0.91s2.162 7.737-0.91 10.354c-12.971 10.581-25.6 14.336-36.41 14.336zM783.473 56.889a10.809 10.809 0 1 0 21.619 0 10.809 10.809 0 1 0-21.618 0zM877.454 186.482a10.809 10.809 0 1 0 21.618 0 10.809 10.809 0 1 0-21.618 0zM869.604 250.88c-1.366 0-2.731-0.341-3.983-1.138-10.467-6.713-13.312-23.097-13.54-24.917-0.568-3.982 2.163-7.737 6.145-8.306 3.982-0.569 7.737 2.048 8.306 6.03 0.568 3.755 3.185 12.288 7.054 14.905 3.413 2.162 4.323 6.713 2.162 10.126-1.366 2.162-3.641 3.3-6.144 3.3z"
            fill="#999999" p-id="4775"></path>
          <path
            d="M863.915 242.233c-0.91 0-1.82-0.228-2.845-0.569-3.754-1.593-5.461-5.803-3.982-9.557 0.569-1.366 14.222-33.337 55.41-41.87 2.275-0.57 17.408-3.641 25.827 5.12 3.414 3.64 6.827 10.353 3.527 22.414-1.137 3.868-5.12 6.144-8.988 5.12-3.868-1.138-6.144-5.12-5.12-8.989 1.138-4.096 1.138-7.168 0-8.306-2.048-2.048-8.76-1.706-12.06-1.024h-0.228c-33.792 6.94-44.828 32.882-44.942 33.11-0.91 2.844-3.641 4.55-6.6 4.55z"
            fill="#999999" p-id="4776"></path>
          <path
            d="M875.065 264.533a7.24 7.24 0 0 1-6.713-4.55c-1.593-3.755 0.228-7.965 3.982-9.558 7.168-2.958 5.006-13.426 4.893-13.881-0.797-3.982 1.706-7.85 5.575-8.647 3.982-0.91 7.85 1.593 8.647 5.461 1.82 7.85 1.251 24.462-13.54 30.606-0.91 0.342-1.82 0.57-2.844 0.57zM939.804 248.15c-2.844 0-5.46-1.594-6.712-4.324-5.917-13.085-20.253-15.588-20.936-15.702-3.982-0.682-6.712-4.323-6.144-8.305s4.324-6.713 8.306-6.144c0.91 0.113 22.756 3.64 32.086 24.12 1.706 3.641 0 7.965-3.641 9.672a6.638 6.638 0 0 1-2.959 0.682z"
            fill="#999999" p-id="4777"></path>
          <path
            d="M886.784 279.666c-0.569 0-1.024-0.114-1.593-0.228-3.982-0.91-6.371-4.778-5.575-8.76 0.114-0.683 3.64-15.816 17.408-24.122 9.557-5.688 21.276-6.826 34.816-3.072 3.868 1.024 6.258 5.12 5.12 8.989s-5.12 6.144-8.988 5.12c-9.558-2.617-17.408-2.048-23.439 1.479-8.305 5.006-10.695 14.677-10.695 14.791-0.682 3.527-3.754 5.803-7.054 5.803z"
            fill="#999999" p-id="4778"></path>
          <path
            d="M909.88 309.02c-1.25 0-2.388-0.34-3.526-0.91-3.527-1.934-4.779-6.371-2.845-9.898 5.348-9.558-0.455-31.63-2.958-38.571-1.365-3.755 0.683-7.965 4.437-9.33 3.869-1.365 7.965 0.683 9.33 4.437 0.114 0.342 2.845 8.192 4.551 17.977 2.503 13.995 1.593 25.031-2.617 32.54-1.365 2.39-3.868 3.755-6.371 3.755z"
            fill="#999999" p-id="4779"></path>
          <path
            d="M911.815 314.596c-22.983 0-37.205-16.043-37.433-16.27-2.617-3.073-2.275-7.738 0.797-10.354s7.623-2.276 10.24 0.796c0.113 0.114 5.916 6.6 15.701 9.671 12.857 3.982 26.738 0.455 41.188-10.695 3.185-2.503 7.736-1.82 10.24 1.365s1.82 7.737-1.366 10.24c-14.79 11.492-28.103 15.247-39.367 15.247zM828.871 436.68c-1.251 0-2.503-0.342-3.755-1.025-21.504-12.63-34.02-28.217-37.319-45.966-4.55-24.804 10.695-44.373 11.378-45.17 2.503-3.186 7.168-3.64 10.24-1.138 3.186 2.503 3.641 7.055 1.138 10.24-0.228 0.228-11.833 15.474-8.42 33.565 2.503 13.426 12.743 25.6 30.379 35.954 3.527 2.048 4.665 6.485 2.617 10.012-1.252 2.276-3.755 3.527-6.258 3.527z"
            fill="#999999" p-id="4780"></path>
          <path
            d="M759.922 396.516c-2.048 0-4.096-0.91-5.575-2.617-2.617-3.072-2.162-7.737 0.91-10.354 5.12-4.324 50.517-41.415 73.273-19.797 2.958 2.73 3.072 7.395 0.227 10.353-2.73 2.959-7.395 3.072-10.353 0.228-6.827-6.485-21.96 0.114-30.265 4.551-12.743 6.827-23.439 15.701-23.552 15.815-1.252 1.252-2.959 1.82-4.665 1.82z"
            fill="#999999" p-id="4781"></path>
          <path
            d="M798.492 426.894c-2.958 0-5.802-1.82-6.826-4.892-1.366-3.755 0.569-7.965 4.437-9.33 21.049-7.623 15.36-45.284 15.246-45.625-0.682-3.982 2.048-7.737 6.03-8.42 3.983-0.682 7.737 2.049 8.42 6.03 0.114 0.456 1.934 12.175 0.228 25.26-2.503 18.887-11.15 31.402-24.918 36.408-0.91 0.455-1.82 0.57-2.617 0.57z m53.931-59.392c3.3 0 5.917 2.617 5.917 5.917s-2.617 5.916-5.917 5.916-5.916-2.617-5.916-5.916 2.617-5.917 5.916-5.917m0-14.677c-11.378 0-20.594 9.216-20.594 20.594 0 11.377 9.216 20.593 20.594 20.593s20.594-9.216 20.594-20.593c0-11.378-9.216-20.594-20.594-20.594zM880.071 471.04c-0.341-0.796-7.964-19.456 14.905-35.726l3.64-2.617c17.181-12.288 31.972-22.87 49.267-20.366 6.371 0.91 15.473 6.713 20.138 20.252 3.414 10.013 2.39 19.229-2.844 24.576-3.3 3.413-9.557 6.713-20.48 3.3-3.869-1.252-6.03-5.348-4.779-9.216s5.348-6.03 9.216-4.779c3.869 1.252 5.462 0.683 5.575 0.455 0.683-0.796 1.366-4.323-0.455-9.671-2.048-6.03-5.916-10.126-8.306-10.468-11.605-1.592-22.983 6.486-38.684 17.864l-3.64 2.616c-12.744 9.103-10.127 17.295-9.786 18.205l-0.114-0.114-13.653 5.689z"
            fill="#999999" p-id="4782"></path>
          <path
            d="M929.906 456.704c-0.91 0-1.82-0.114-2.617-0.455-3.755-1.48-5.689-5.689-4.21-9.444 3.755-9.67-1.707-37.091-5.916-52.11-1.138-3.868 1.137-7.964 5.006-8.988 3.868-1.138 7.964 1.137 8.988 5.006 1.252 4.437 12.175 44.146 5.462 61.326-0.91 2.958-3.755 4.665-6.713 4.665z"
            fill="#999999" p-id="4783"></path>
          <path
            d="M937.756 487.424c-2.503 0-5.006-0.228-7.395-0.683-9.785-1.706-23.21-9.443-32.2-35.953-4.892-14.678-6.257-28.445-6.37-29.014-0.342-3.982 2.502-7.623 6.598-7.964 3.983-0.342 7.623 2.503 7.965 6.599 1.251 12.515 8.76 48.81 26.51 51.996 9.444 1.707 21.96-1.706 36.295-9.785 11.492-6.485 19.911-13.653 20.025-13.767 3.072-2.617 7.737-2.275 10.354 0.797s2.275 7.623-0.797 10.354c-1.365 1.137-32.313 27.42-60.985 27.42zM630.556 972.231a7.332 7.332 0 0 1-6.485-3.868c-1.934-3.527-0.455-7.965 3.072-9.899 15.929-8.42 28.217-22.187 33.792-37.888 4.324-12.06 4.551-28.672 0.569-32.313-1.934-1.707-6.94 0.341-9.102 1.252-9.899 4.665-20.594 9.443-31.744 12.97-76.8 23.894-160.086 19.229-240.868-13.198-74.98-30.151-143.132-83.171-191.943-149.163C134.6 667.99 98.532 577.991 86.585 486.628c-12.97-98.532 2.275-191.147 44.146-267.833 25.03-45.853 60.188-85.106 101.717-113.55 42.78-29.355 92.388-46.99 143.36-51.2 105.7-8.648 215.268 30.492 285.81 102.172 0.227 0.227 0.341 0.455 0.569 0.569 17.066 21.731 38.912 51.541 56.661 89.315 19.115 40.391 30.037 82.034 33.45 127.204 4.097 53.703-3.071 112.526-21.048 174.763-20.594 71.11-56.093 149.276-105.472 232.22-5.234 9.216-10.468 21.845-5.348 29.696 5.462 8.42 21.618 10.809 35.271 9.557 17.295-1.706 33.337 4.551 45.284 17.408 13.54 14.678 19.57 35.613 16.043 55.979-7.055 40.732-38.344 56.32-68.722 71.225l-14.336 7.168c-1.138 0.683-2.276 0.91-3.414 0.91z m28.786-99.214c5.462 0 9.33 2.162 11.947 4.437 12.63 11.492 6.599 39.254 3.413 48.014-1.251 3.528-2.73 6.827-4.437 10.127 16.043-10.354 28.558-23.552 32.313-45.17 2.73-15.701-2.048-32.427-12.402-43.577-8.76-9.444-20.48-13.995-33.11-12.743-8.533 0.796-37.205 2.048-49.038-16.157-7.281-11.264-5.688-26.396 4.893-44.942 0 0 0-0.114 0.114-0.114 48.81-81.92 83.854-158.947 103.993-228.807 17.521-60.643 24.462-117.76 20.48-169.642-7.168-94.777-47.787-158.493-86.813-208.214-67.584-68.494-172.487-105.927-273.863-97.621-48.47 3.982-95.573 20.821-136.306 48.697-39.594 27.079-73.159 64.626-97.052 108.544-40.278 73.955-55.069 163.499-42.44 258.958 11.72 88.974 46.65 176.583 98.532 246.67 47.218 63.83 113.095 115.143 185.572 144.27 77.71 31.29 157.582 35.727 231.082 12.857 10.24-3.185 20.025-7.623 29.924-12.288 5.234-2.389 9.557-3.3 13.198-3.3z"
            fill="#999999" p-id="4784"></path>
          <path
            d="M442.596 230.286c-35.5 0-71.68-4.437-108.09-13.084-87.722-21.05-145.862-59.506-148.252-61.099-3.413-2.275-4.21-6.827-2.048-10.126 2.276-3.413 6.827-4.21 10.126-2.048 0.683 0.455 58.824 38.798 144.043 59.164 49.949 11.947 99.328 15.36 146.66 10.354 59.164-6.258 115.484-25.827 167.367-58.368 3.413-2.162 7.964-1.138 10.126 2.276 2.162 3.413 1.138 7.964-2.276 10.126-53.93 33.678-112.412 54.044-173.852 60.53-14.45 1.593-29.127 2.275-43.804 2.275z"
            fill="#999999" p-id="4785"></path>
          <path
            d="M435.996 231.196c-56.888 0-92.046-11.719-94.094-12.401a6.993 6.993 0 0 1-4.55-4.551c-0.684-2.162-0.456-4.552 0.91-6.372L430.875 70.77a7.251 7.251 0 0 1 6.372-3.186c2.503 0.114 4.892 1.48 6.03 3.755 2.617 4.665 64.285 115.825 75.549 143.018 0.796 2.048 0.682 4.324-0.342 6.258-1.024 1.934-2.958 3.3-5.12 3.641-28.672 5.12-54.727 6.94-77.369 6.94z m-79.985-23.665c20.707 5.12 74.183 14.905 145.521 3.868-13.994-29.24-50.972-96.597-65.308-122.539l-80.213 118.67z m-70.884 106.837c-1.251 0-2.617 0-3.982-0.114-3.982-0.114-7.168-3.527-7.054-7.623 0.113-3.982 3.527-7.168 7.623-7.054 15.246 0.569 26.055-2.503 32.313-8.989 6.485-6.826 5.916-15.473 5.802-15.928-0.455-3.983 2.503-7.624 6.486-7.965 3.982-0.455 7.623 2.503 8.078 6.6 0.114 0.568 1.479 15.36-9.557 27.192-8.534 9.216-21.96 13.881-39.709 13.881z m250.88 2.844c-4.437 0-8.76-0.91-13.084-2.616-21.163-8.761-32.086-36.637-32.54-37.888-1.48-3.755 0.454-7.965 4.209-9.444 3.755-1.48 7.964 0.455 9.444 4.21 0.113 0.227 9.102 23.324 24.462 29.582 5.347 2.276 10.922 2.048 16.953-0.683 3.64-1.593 7.964 0 9.67 3.641s0 7.965-3.64 9.671c-5.234 2.39-10.354 3.527-15.474 3.527zM346.34 372.85H229.376c-4.551 0-8.192-3.755-8.192-8.192 0-4.551 3.755-8.192 8.192-8.192h117.077c4.551 0 8.192 3.754 8.192 8.192 0 4.437-3.754 8.192-8.305 8.192z m-19.343 14.222H255.66c-3.869 0-7.055-3.186-7.055-7.054 0-3.869 3.186-7.054 7.055-7.054h71.338c3.869 0 7.055 3.185 7.055 7.054 0 3.868-3.186 7.054-7.055 7.054z m20.253 14.564H232.107c-3.983 0-7.282-3.3-7.282-7.282s3.3-7.282 7.282-7.282h115.257c3.982 0 7.281 3.3 7.281 7.282s-3.3 7.282-7.395 7.282z m263.054-27.876H493.227c-4.551 0-8.192-3.755-8.192-8.192 0-4.551 3.754-8.192 8.192-8.192h117.077c4.551 0 8.192 3.755 8.192 8.192s-3.64 8.192-8.192 8.192z m-19.456 14.222h-71.339c-3.868 0-7.054-3.186-7.054-7.054 0-3.868 3.186-7.054 7.054-7.054h71.339c3.868 0 7.054 3.186 7.054 7.054 0.114 3.868-3.186 7.054-7.054 7.054z m20.366 14.564H496.071c-3.982 0-7.282-3.3-7.282-7.282s3.3-7.282 7.282-7.282h115.257c3.982 0 7.282 3.3 7.282 7.282-0.114 3.982-3.414 7.282-7.396 7.282zM210.148 427.69c5.688 0 10.353 4.665 10.353 10.353s-4.665 10.354-10.353 10.354-10.354-4.665-10.354-10.354 4.665-10.353 10.354-10.353m0-14.564c-13.768 0-25.032 11.15-25.032 25.031 0 13.767 11.15 25.031 25.032 25.031 13.767 0 25.03-11.15 25.03-25.03s-11.263-25.032-25.03-25.032z m19 93.753c0.57 0 1.138 0.455 1.138 1.138s-0.455 1.138-1.138 1.138-1.137-0.456-1.137-1.138 0.569-1.138 1.137-1.138m0-14.564c-8.647 0-15.7 7.055-15.7 15.702s7.053 15.701 15.7 15.701 15.702-7.054 15.702-15.701c0.114-8.647-6.94-15.702-15.702-15.702z m6.03 87.95c3.186 0 5.69 2.618 5.69 5.69 0 3.185-2.617 5.688-5.69 5.688s-5.688-2.616-5.688-5.688c-0.114-3.072 2.503-5.69 5.689-5.69m0-14.563c-11.264 0-20.367 9.102-20.367 20.366s9.103 20.367 20.367 20.367 20.366-9.103 20.366-20.367c0-11.264-9.216-20.366-20.366-20.366z"
            fill="#999999" p-id="4786"></path>
          <path
            d="M613.035 413.582c5.006 0 8.988 3.982 8.988 8.989s-3.982 8.988-8.988 8.988-8.989-3.982-8.989-8.988 3.982-8.989 8.989-8.989m0-14.677c-13.085 0-23.552 10.581-23.552 23.552s10.581 23.552 23.552 23.552c13.084 0 23.552-10.581 23.552-23.552s-10.582-23.552-23.552-23.552z m-6.713 70.883c-6.713 0-12.174 5.462-12.174 12.175s5.46 12.174 12.174 12.174 12.174-5.461 12.174-12.174-5.461-12.175-12.174-12.175z m12.174 87.95c4.437 0 7.964 3.528 7.964 7.965s-3.527 7.965-7.964 7.965-7.964-3.528-7.964-7.965 3.64-7.964 7.964-7.964m0-14.678c-12.516 0-22.642 10.127-22.642 22.642s10.126 22.642 22.642 22.642 22.642-10.126 22.642-22.642-10.126-22.642-22.642-22.642z m-230.969-53.817c-2.275 0-4.437-1.024-5.916-2.958-2.39-3.3-1.707-7.85 1.593-10.24l28.558-20.935c9.443-6.94 21.959-6.827 31.402 0.114l28.104 20.821c3.3 2.39 3.868 6.94 1.479 10.24-2.39 3.3-6.94 3.869-10.24 1.48l-28.103-20.822c-4.21-3.072-9.785-3.072-13.995 0l-28.558 20.935c-1.252 0.91-2.731 1.365-4.324 1.365z m-71.794 166.457c-1.479 0-2.844-0.113-4.323-0.455-12.174-2.275-20.935-9.33-26.738-21.39-4.892-10.126-2.39-18.09-0.455-23.893 2.275-6.827 3.3-9.899-7.282-18.205-3.186-2.503-3.755-7.054-1.251-10.24 2.503-3.186 7.054-3.754 10.24-1.251 17.18 13.425 15.587 23.893 12.174 34.247-1.593 4.892-2.617 8.078-0.342 12.97 4.893 10.013 11.037 12.402 16.384 13.426 4.552 0.91 9.103-2.048 10.468-6.599 6.6-22.528 3.982-41.756-7.51-57.116-9.443-12.63-22.414-19.115-27.989-20.822-10.126-3.072-25.827 1.48-30.947 3.527a7.259 7.259 0 0 1-9.444-4.096 7.259 7.259 0 0 1 4.096-9.443c2.39-0.91 23.78-8.989 40.619-3.869 9.557 2.959 24.576 11.492 35.385 26.056 9.898 13.312 19.683 36.18 9.898 69.973-2.958 10.126-12.629 17.18-22.983 17.18z m218.34-6.144c-6.372 0-12.06-2.617-16.498-7.737-13.653-13.54-20.48-30.947-19.683-50.176 0.91-23.096 12.515-42.78 20.366-49.265 1.479-1.252 3.413-1.82 5.347-1.707 23.552 2.276 38.116-4.096 38.23-4.21 3.64-1.706 7.964-0.114 9.67 3.527s0.115 7.965-3.526 9.671c-0.683 0.342-16.612 7.624-42.44 5.803-5.006 5.917-12.515 20.139-13.198 36.637-0.682 15.36 4.551 28.558 15.588 39.367l0.455 0.455c1.707 1.934 4.096 3.754 8.988 2.275 2.959-0.91 5.462-2.503 6.144-3.072 1.707-1.82 13.768-16.384 3.072-48.241-1.251-3.869 0.797-7.965 4.552-9.216 3.868-1.252 7.964 0.796 9.216 4.55 14.45 43.009-6.258 62.92-7.168 63.716-0.114 0.114-0.228 0.228-0.456 0.342-0.455 0.455-5.12 3.982-11.377 5.916-2.39 0.91-4.893 1.365-7.282 1.365z"
            fill="#999999" p-id="4787"></path>
        </svg>
      </div>
    </ul>
  </div>
</template>
<script setup lang="ts">
import { useMyData } from "@/hooks/myData"
import { ref } from "vue";
import route from '@/router/index'
let { data, getData, getAddData, loading } = useMyData()

// 切换筛选条件的状态
// 筛选list
let filterList = [
  "我发布的竞赛",
  "待提交的竞赛",
  "我报名的竞赛",
];
let currentIndex = ref(0);
const handleClick = async (index: number) => {
  currentIndex.value = index;
  // 根据index请求数据
  if (index === 0) {
    data.value = await getAddData()
  }
  if (index === 1) {
    // 待提交的竞赛,
    data.value = await getData("1", "0")
  }
  if (index === 2) {
    // 报名成功
    data.value = await getData("0", "0")
  }
};


</script>
<style scoped lang="scss">
.screen-box {
  display: flex;
  margin: 10px 0;

  span {
    padding: 10px;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s;
    margin-right: 10px;

    &:hover {
      background-color: #ccc;
    }
  }

  .active {
    background-color: #ccc;
  }
}

.container {
  width: 1080px;

  .box {
    box-sizing: border-box;

    .text {
      p {
        padding: 10px 0;
      }
    }

    .box-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      border: 1px solid #ccc;
      border-radius: 10px;
      margin-top: 20px;
      padding: 10px 10px;
      cursor: pointer;

      .btn {
        display: flex;
        flex-direction: column;

        button {
          margin: 10px;
        }
      }
    }
  }
}
</style>
